module.exports = function ($scope, $resource, $modal, toaster) {


	$scope.getTravelList = function() {
		$scope.searchform.loading = true;
		$scope.searchform.status = '2';
		$resource('/api/as/goc/outboundtravel/getTravelList', {}, {}).save($scope.searchform, function(res){
            if (res.errcode === 0) {
				$scope.list = res.data;
				$scope.searchform.loading = false;
            } else {
                toaster.error({title: '', body: '查询出境游信息失败'});
            }
        });
	}
	
	init();
	function init() {
		$scope.searchform = {};
		$scope.getTravelList();
	}


	$scope.signup = function(info){
		var modalInstance = $modal.open({
			template: require('../views/saleSignUp.html'),
			controller: 'saleSignUp',
			size: 'lg',
			resolve: {
				getDate : function(utilservice){
					return utilservice.getDate;
				},
				travel: function () {
					return info;
				},
				people: function () {
					return null;
				}
			}
		});
	}



};